import java.util.Scanner;

public class maifeijipiao {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入飞机票的原价");
        int money = sc.nextInt();
        System.out.println("请输入购票月份");
        int mouth = sc.nextInt();
        System.out.println("头等舱按1 经济舱按2 货舱按3 出舱按4 第5人格");
        int seat = sc.nextInt();
        if (mouth > 0 && mouth <= 12) {
            if (mouth > 5 && mouth < 10) {
                money = getPrice(money, seat, 0.9, 0.85);
            } else {
                money = getPrice(money, seat, 0.7, 0.65);
            }
        } else {
            System.out.println("叉出去");
        }
        System.out.println(money);
    }

    public static int getPrice(int money, int seat, double v0, double v1) {
        if (seat == 1) {
            money = (int) (money * v0);
        }
        if (seat == 2) {
            money = (int) (money * v1);
        }
        if (seat != 1 && seat != 2) {
            System.out.println("叉出去");
        }
        return money;
    }
}